import mysql.connector.pooling

__config = {
    "host": "localhost",
    "port": 3306,
    "user": "root",
    "password": "1234",
    "database": "canteen"
}

try:
    pool = mysql.connector.pooling.MySQLConnectionPool(
        **__config,
        pool_size=10
    )
except Exception as e:
    print(e)

# 新连接池
# __config_new = {
#     "host": "localhost",
#     "port": 3306,
#     "user": "root",
#     "password": "1234",
#     "database": "canteen"
# }
#
# try:
#     pool = mysql.connector.pooling.MySQLConnectionPool(
#         **__config,
#         pool_size=10
#     )
# except Exception as e:
#     print(e)
